package com.suixinsanren.design.state.demo.demo01;

/**
 * 未投币状态
 */
public class NoQuarterState implements State {

    private GumballMachine gumballMachine;

    public NoQuarterState(GumballMachine gumballMachine) {
        this.gumballMachine = gumballMachine;
    }

    @Override
    public void insertQuarter() {
        System.out.println("你投了1个硬币");
        gumballMachine.setState(gumballMachine.getHasQuarterState());
    }

    @Override
    public void ejectQuarter() {
        System.out.println("你还没有投入硬币");
    }

    @Override
    public void turnCrank() {
        System.out.println("需要先投币才能转动曲柄");
    }

    @Override
    public void dispense() {

    }
}
